package com.cgx.controller;

import com.cgx.annotation.ResultHandler;
import com.cgx.entity.User.User;
import com.cgx.service.UserService;
import com.cgx.vo.RequestObject;
import com.cgx.vo.base.BaseIdListVo;
import com.cgx.vo.user.UserInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author chenguanxin
 * @date 2021-05-12 22:29
 */
@Controller
@CrossOrigin("*")
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @ResponseBody
    @RequestMapping("/getUserListByIdList")
    public List<User> getUserListByIdList(@RequestBody List<String> idList) {
        return userService.getUserListByIdList(idList);
    }

    @ResponseBody
    @RequestMapping("/getUserInfo")
    public List<UserInfoVo> getUserInfo(@RequestBody List<String> idList) {
        return userService.getUserInfo(idList);
    }
}
